<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>索引选择器测试排除</title>
	<link rel="stylesheet" type="text/css" href="css/txt.css" />
	<script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
</head>

<body>

	<div>
		<div>1-1、www.mldn.cn</div>
	</div>
	<div>
		<div>1-2、www.mldn.cn</div>
	</div>
	<div><span>2-1、www.mldn.cn</span></div>
	<div><span>2-2、www.mldn.cn</span></div>
	<div>
		<p>3-1、www.mldn.cn</p>
	</div>
	<div>
		<p>3-2、www.mldn.cn</p>
	</div>

</body>

<script type="text/javascript">
	$(function() {

			$("div *:not(p)").attr("class","txt");

		});
</script>

</html>